package com.idreems.zakerlike.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

// 保存相关的配置信息
public class PreferencesPro {
    private SharedPreferences mPref;
    private Editor mEditor;
    private Context mContext;

    private static PreferencesPro mPreferences;

    public static PreferencesPro getInstance(Context context) {
        if (mPreferences == null) {
            mPreferences = new PreferencesPro(context);
        }
        return mPreferences;
    }

    public PreferencesPro(Context context) {
        mPref = context.getSharedPreferences("nqsdkconfig", 0);
        mEditor = mPref.edit();
        mContext = context;
    }

    /**
     * 设置积分数
     * 
     * @param amount
     */
    public void setAdsOn(boolean enable) {
        mEditor.putBoolean("setAdsOn",enable);
        mEditor.commit();
    }

    /**
     * 获取积分数
     */
    public boolean adsOn() {
        return mPref.getBoolean("setAdsOn", true);
    }
}
